<?php
    $syscontact = snmp2_real_walk($machine->getAdresseIp(), $machine->getCommunity(), '.iso.org.dod.internet.mgmt.mib-2.host.hrSystem.hrSystemUptime.0');
    $syscontact = reset($syscontact);
    $pattern = "/\).*/";
    $uptimes = array();
    $o = "";
    preg_match($pattern, $syscontact, $uptimes);
    foreach($uptimes as $uptime) {
        $uptime = str_replace(") ", "", $uptime);
    }
    $criticite = null;
    if(!empty($uptime)) {
        $message = $uptime;
    }
    else {
        $message = "Impossible de récupérer l'uptime de ce serveur";
    }
?>
